<!doctype html>
{php}
    $static = '/static/home/';
{/php}
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>{$siteConfig['seo_title']}</title>
    <meta name="apple-mobile-web-app-title" content="{$siteConfig['seo_title']}">
    <meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0,maximum-scale=1.0,user-scalable=no,width=device-width">
    <link rel="shortcut icon" href="{$static}images/favicon.ico">
    <link href="{$static}css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="{$static}css/icons.min.css" rel="stylesheet" type="text/css" />
    <link href="{$static}css/app.min.css" rel="stylesheet" type="text/css" />
    <link href="{$static}css/style.css" rel="stylesheet" type="text/css" />
</head>
<style type="text/css">
    .card-body{
        padding:.8rem;
    }
</style>
<body data-sidebar="dark">
<div id="layout-wrapper">
    {include file='public/mine_topbar' /}
    {include file='public/mine_left' /}
    <div class="main-content">

        <div class="page-content">
            <form action="{:url('url/index')}">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-12">
                        <div class="card">
                            <div class="card-body">
                                <div class="row mb-2">
                                    <div class="col-xl-2 col-md-6">
                                        起始时间：<input type="text" class="form-control" id="startDate" name="startDate"
                                                    value="{$params['startDate']}" placeholder="请输入起始时间">
                                    </div>
                                    <div class="col-xl-2 col-md-6">
                                        结束时间：<input type="text" class="form-control" id="endDate" name="endDate"
                                                    value="{$params['endDate']}" placeholder="请输入结束时间">
                                    </div>
                                    <div class="col-xl-2 col-md-6">
                                        短链关键词：<input type="text" class="form-control" name="keyword"
                                                   value="{$params['keyword']}" placeholder="请输入关键词例如：a3A4bp">
                                    </div>
                                    <div class="col-xl-3 col-md-6">
                                        原始链接：<input type="text" class="form-control" name="link"
                                                    value="{$params['link']}" placeholder="请输入原始链接">
                                    </div>
                                    <div class="col-xl-2 col-md-6">
                                        排序：
                                        <select class="form-control custom-select" name="sort">
                                            <option value="create_time" {if condition="$params['sort'] eq 'create_time'"}selected{/if}>创建时间</option>
                                            <option value="clicks" {if condition="$params['sort'] eq 'clicks'"}selected{/if} >访问量</option>
                                        </select>　
                                    </div>
                                    <div class="col-xl-2 col-md-6">
                                        分组：
                                        <select class="form-control custom-select" name="groupId">
                                            <option value="0">默认分组</option>
                                            {foreach name="groupList" item="vo"}
                                                <option value="{$vo.groupId}" {if condition="$params['groupId'] eq $vo['groupId']"}selected{/if}>{$vo.groupName}</option>
                                            {/foreach}
                                        </select>　
                                    </div>
                                    <div class="col-xl-2 col-md-6">
                                        渠道：
                                        <select class="form-control custom-select" name="channelId">
                                            <option value="0">默认无</option>
                                            {foreach name="channelList" item="vo"}
                                            <option value="{$vo.channelId}" {if condition="$params['channelId'] eq $vo['channelId']"}selected{/if}>【渠道：{$vo.channelName}】【 渠道码：{$vo.channelCode} 】</option>
                                            {/foreach}
                                        </select>　
                                    </div>
                                    <div class="col-xl-1 col-md-6">　　　　
                                        <button type="submit" class="btn btn-primary btn-block">
                                            <i class="mdi mdi-file-search-outline"></i>
                                            <span class="title">搜索</span>
                                        </button>
                                    </div>
                                    <div class="col-xl-1 col-md-6">　　　　
                                        <a class="btn btn-danger btn-block" href="{:url('url/index')}">
                                            <i class="mdi mdi-broom"></i>
                                            <span class="title">清空</span>
                                        </a>
                                    </div>
                                    <div class="col-xl-2 col-md-6">　　　　
                                        <a class="btn btn-success btn-block" href="{:url('url/build')}">
                                            <i class="mdi mdi-link-variant-plus"></i>
                                            <span class="title">新建链接</span>
                                        </a>
                                    </div>
                                    <div class="col-xl-2 col-md-6">　　　　
                                        <a class="btn btn-primary btn-block" href="{:url('urlGroup/add')}">
                                            <i class="mdi mdi-file-multiple-outline"></i>
                                            <span class="title">新建分组</span>
                                        </a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div> <!-- end col -->
                </div> <!-- end row -->

                {foreach name="list" item="vo"}
                <div class="row">
                    <div class="col-12">
                        <div class="card">
                            <div class="card-body">
                                <div class="row items-title">
                                    <div class="col-xl-6 col-md-6">
                                        <i class="mdi mdi-file-multiple-outline"></i> 专业的短链链接
                                    </div>
                                    <div class="col-xl-6 col-md-6 text-right">
                                        生成时间：{$vo.create_time}
                                    </div>
                                </div>
                                <div class="dropdown-divider"></div>
                                <div class="row items-content">
                                    <div class="col-xl-5 col-md-6">
                                        <div class="row">
                                            <div class="col-xl-3 col-md-6">
                                                <div class="items-link-up">
                                                    短链链接
                                                </div>
                                                <div class="items-link-down">
                                                    原始链接
                                                </div>
                                            </div>
                                            <div class="col-xl-9 col-md-6">
                                                <div class="items-link-up">
                                                    <a href="{$vo.shortUrl}" target="_blank">{$vo.shortUrl}</a>
                                                </div>
                                                <div class="items-link-down">
                                                    <a href="{$vo.link}" target="_blank">{$vo.link}</a>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="col-xl-5 col-md-6">
                                        <div class="row">
                                            <div class="col-xl-3 col-md-6">
                                                <div class="items-link-up">总浏览（PV）</div>
                                                <div class="items-link-down">{$vo.clicks}</div>
                                            </div>
                                            <div class="col-xl-3 col-md-6">
                                                <div class="items-link-up">今日浏览（PV）</div>
                                                <div class="items-link-down">{$vo.todayPv}</div>
                                            </div>
                                            <div class="col-xl-3 col-md-6">
                                                <div class="items-link-up">今日访问（UV）</div>
                                                <div class="items-link-down">{$vo.todayUv}</div>
                                            </div>
                                            <div class="col-xl-3 col-md-6">
                                                <div class="items-link-up">今日IP（IP）</div>
                                                <div class="items-link-down">{$vo.todayIp}</div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-xl-2 col-md-6">
                                        <div class="row pt-3">
                                            <div class="col-xl-6 col-md-6">
                                                <a href="{:url('url/setting', array('id' => $vo.url_id))}" class="btn btn-info btn-block">
                                                    <i class="mdi mdi-file-document-edit-outline"></i>
                                                    <span class="title ">设置</span>
                                                </a>
                                            </div>
                                            <div class="col-xl-6 col-md-6">
                                                <a href="{:url('url/statistics', array('id' => $vo.url_id))}" class="btn btn-primary btn-block">
                                                    <i class="mdi mdi-chart-areaspline"></i>
                                                    <span class="title ">统 计</span>
                                                </a>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div> <!-- end col -->
                </div> <!-- end row -->
                {/foreach}

                {notempty name="pagination"}
                <div class="row">
                    <div class="col-12">
                        <div class="card">
                            <div class="card-body">
                                {:$pagination}
                            </div>
                        </div>
                    </div> <!-- end col -->
                </div> <!-- end row -->
                {/notempty}

            </div> <!-- container-fluid -->
            </form>
        </div>
        <!-- End Page-content -->
    </div>
    <!-- end main content-->
</div>
<!-- END layout-wrapper -->

<style type="text/css">
    .items-title {
        height: 30px;
    }
    .items-content {
        padding: 15px 0;
    }
    .items-link-up {
        height: 35px;
        overflow: hidden;
    }
    .items-link-down {
        height: 40px;
        padding-top: 1rem;
    }
</style>

<!-- JAVASCRIPT -->
<script src="{$static}libs/jquery/jquery.min.js"></script>
<script src="{$static}libs/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="{$static}libs/metismenu/metisMenu.min.js"></script>
<script src="{$static}libs/simplebar/simplebar.min.js"></script>
<script src="{$static}libs/node-waves/waves.min.js"></script>
<script src="{$static}libs/layer/layer.js"></script>

<script src="{$static}libs/rolldate/rolldate.min.js"></script>
<script type="text/javascript" src="{$static}js/app.js"></script>
<script type="text/javascript">
    $(function () {
        //时间选择器
        new Rolldate({
            el: '#startDate',
            format: 'YYYY-MM-DD',
            beginYear: 2019,
            endYear: 2100
        });
        new Rolldate({
            el: '#endDate',
            format: 'YYYY-MM-DD',
            beginYear: 2019,
            endYear: 2100
        });

    });
</script>
</body>
</html>
